package com.boot;

import com.boot.notes.event.OrderEvent;
import com.boot.notes.event.RegisterEvent;
import org.apache.rocketmq.client.producer.SendCallback;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ApplicationListener;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.scheduling.annotation.EnableAsync;

import java.math.BigDecimal;

@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
@EnableAsync
//@NacosPropertySource(dataId = "example", autoRefreshed = true)
public class SpringbootApplication {

	@Autowired
	private RocketMQTemplate rocketMQTemplate;

	public static void main(String[] args) {
		SpringApplication.run(SpringbootApplication.class, args);
//		ConfigurableApplicationContext context = SpringApplication.run(SpringbootApplication.class, args);
//
//		//发布事件
//		context.publishEvent(new RegisterEvent("测试事件","123456",1l));
//		context.publishEvent(new OrderEvent("订单事件","123456",2l));

	}


}
